/*
 * include librairie graphique
 */


var System = {
	TabControl: null,
	
	//constructeur
	iniatialize: function(){
		this.startInterface();	
	},
/**
 *  System.startInterface() -> void
 *
 * Initialise l'interface et intercepte les éléments lors du chargement de chaque page 
 **/
	startInterface: function(){		
		//recupération du tabControl
		this.TabControl = new TabControl($J('.tab-control')[0]);
		
		//si simpleTable existe, on l'intercepte
		if($J('.simple-table').length > 0){

			for(var i=0;i<$J('.simple-table').length;i++){
				var simpleTable = 	new SimpleTable($J('.simple-table')[i]);
				var screenHeight =	$Body.getHeight() - simpleTable.cumulativeOffset().top - 10;
				
				if(simpleTable.getHeight() < screenHeight) continue;
				
				simpleTable.setStyle('height: ' + screenHeight + 'px');
			}
			
		}
	}
}

Extends.ready(System.iniatialize.bind(System));

